import { postRequest, getRequest, postDownload } from '/@/lib/axios';

const baseUrl = "/iotApp"

export const iotApi = {

  /**
   * 分页查询  @author  hzw
   */
  queryPage: (param) => {
    return postRequest(baseUrl + '/queryPage', param);
  },

  queryList: (param) => {
    return postRequest(baseUrl + '/queryList', param);
  },

  /**
   * 详情查询  @author  hzw
   */
  getDetailById: (param) => {
    return postRequest(baseUrl + '/queryOne', param);
  },

  /**
   * 增加  @author  hzw
   */
  add: (param) => {
    return postRequest(baseUrl + '/add', param);
  },

  /**
   * 修改  @author  hzw
   */
  update: (param) => {
    return postRequest(baseUrl + '/update', param);
  },

  /**
   * 删除  @author  hzw
   */
  delete: (id) => {
    return getRequest(baseUrl + `/delete/${id}`);
  },

  /**
   * 批量删除  @author  hzw
   */
  batchDelete: (idList) => {
    return postRequest(baseUrl + '/batchDelete', idList);
  },

  /**
   * 应用开关控制  @author  hzw
   */
  switchStatus: (param) => {
    return postRequest(baseUrl + '/switchStatus', param);
  },

  /**
   * 导入  @author  hzw
   */
  importFile: (param) => {
    return postRequest(baseUrl + "/import", param);
  },

  /**
   * 导出  @author  hzw
   */
  exportFile: (param) => {
    return postDownload(baseUrl + "/export", param);
  },

};
